<?php

class Log{
	public static $instances;
	public static $instance;
	
	/**
	 * 获取log实例
	 *
	 * @param string $type
	 * @return Zend_Log
	 */
	public static function getInstance(){
		if(!self::$instance){
			self::$instance = self::createInstance();
		}
		return self::$instance;
	}
	
	/**
	 * 创建log
	 *
	 * @param String $type
	 * @return Zend_Log
	 */
	private static function createInstance(){
		$writer = new Zend_Log_Writer_Stream(LOG_PATH."/log.txt");
		$log = new Zend_Log($writer);
		return $log;
	}
}